
# 预定义图层样式配置
LAYER_STYLES = {
    "M_COVR": {  # 海图范围 - 红色边框
        "type": "fill",
        "color": "0,0,0,0",  # 透明填充
        "outline": "255,0,0,255",  # 红色边框
        "width": "0.3"
    },
    "ADMARE": {  # 行政区域 - 淡紫色
        "type": "fill",
        "color": "181,99,214,150",  # 淡紫色
        "outline": "128,0,128,180",  # 紫色边框
        "width": "0.6"
    },
    "UWTROC": {  # 水下障碍物 - 绿色三角形
        "type": "marker",
        "color": "0,255,0,255",  # 绿色
        "size": "4",
        "shape": "triangle"
    },
    "LNDARE": {  # 陆地 - 深绿色
        "type": "fill",
        "color": "34,139,34,200",  # 深绿色
        "outline": "139,69,19,180",
        "width": "0.3"
    },
    "SEAARE": {  # 海域 - 浅蓝色
        "type": "fill",
        "color": "135,206,250,100",  # 浅蓝色
        "outline": "70,130,180,180",
        "width": "0.2"
    },
    "DEPARE": {  # 水深区域 - 淡蓝色
        "type": "fill",
        "color": "173,216,230,120",  # 淡蓝色
        "outline": "100,149,237,180",
        "width": "0.2"
    },
    "DEPCNT": {  # 等深线 - 蓝色虚线
        "type": "line",
        "color": "0,0,255,150",  # 蓝色
        "width": "0.5",
        "style": "dash"
    },
    "LIGHTS": {  # 灯标 - 黄色圆点
        "type": "marker",
        "color": "255,255,0,255",  # 黄色
        "size": "3",
        "shape": "circle",
        "outline": "black"
    },
    "TOPMAR": {  # 顶部标 - 灰色
        "type": "marker",
        "color": "180,180,180,255",  # 灰色
        "size": "3",
        "shape": "circle",
        "outline": "black"
    },
    "BCNSPP": {  # 浮标 - 灰色
        "type": "marker",
        "color": "180,180,180,255",  # 灰色
        "size": "3",
        "shape": "circle",
        "outline": "black"
    },
    "PILPNT": {  # 引航点 - 黄色
        "type": "marker",
        "color": "255,255,0,255",  # 黄色
        "size": "3",
        "shape": "circle",
        "outline": "black"
    },
    "WRECKS": {  # 沉船 - 红色菱形
        "type": "marker",
        "color": "255,0,0,255",  # 红色
        "size": "4",
        "shape": "diamond"
    },
    "OBSTRN": {  # 障碍物 - 红色三角形
        "type": "marker",
        "color": "255,0,0,255",  # 红色
        "size": "4",
        "shape": "triangle"
    },
    "SOUNDG": {  # 水深点 - 绿色
        "type": "marker",
        "color": "0,255,0,255",  # 绿色
        "size": "2",
        "shape": "circle"
    }
}

# 图层加载顺序
LAYER_PRIORITY = [
    "M_QUAL", "M_NSYS", "M_SDAT", "DSID",
    "DEPCNT", "DEPARE", "SOUNDG",
    "LIGHTS", "TOPMAR", "BCNSPP", "PILPNT",
    "WRECKS", "OBSTRN", "UWTROC",
    "ADMARE", "AIRARE", "BUAARE", "CTNARE", "RESARE", "SBDARE",
    "BOYINB", "BOYSAW", "BOYSPP", "CBLSUB", "COALNE",
    "CTRPNT", "CURENT", "DMPGRD", "FOGSIG", "HRBARE",
    "LAKARE", "LNDARE",
    "M_COVR"
]

# 图层分组映射
GROUP_MAPPING = {
    "基础要素": ["M_COVR", "M_QUAL", "M_NSYS", "M_SDAT", "DSID"],
    "水深要素": ["DEPCNT", "DEPARE", "SOUNDG"],
    "助航": ["LIGHTS", "TOPMAR", "BCNSPP", "PILPNT"],
    "障碍物": ["WRECKS", "OBSTRN", "UWTROC"],
    "区域": ["ADMARE", "AIRARE", "BUAARE", "CTNARE", "RESARE", "SBDARE"],
    "其他": ["BOYINB", "BOYSAW", "BOYSPP", "CBLSUB", "COALNE",
             "CTRPNT", "CURENT", "DMPGRD", "FOGSIG", "HRBARE",
             "LAKARE", "LNDARE"]
}